package com.mobulasoft.calquest;

import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources.NotFoundException;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.util.Linkify;
import android.view.View;
import android.widget.TextView;

public class About extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		configureTitle();
		try {
			setTitle(getResources().getString(R.string.about_criticker) + " v"
					+ getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
		} catch (NotFoundException e) {
		} catch (NameNotFoundException e) {
		}
		setContentView(R.layout.about);
		TextView urlTv = (TextView) findViewById(R.id.about_url);
		SpannableString url = new SpannableString("http://www.mobulasoft.com\ninfo@mobulasoft.com");
		urlTv.setText(url);
		Linkify.addLinks(urlTv, Linkify.ALL);
	}
	
	private void configureTitle() {
		TextView titleView = (TextView) findViewById(android.R.id.title);
		titleView.setPadding(10, 9, 10, 10);
		titleView.setMinimumHeight(0);
		titleView.setMinHeight(0);
	}

	public void dismiss(View v) {
		finish();
	}

}
